package com.example.commom.exception;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author: bebm
 * @date: 2022/3/30 20:12
 * @description:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public final class ErrorCode implements Serializable {

    private String code;

    private String message;

    private  int httpCode;

    public static final ErrorCode OK=registerErrorCode("000000","ok");


    public static ErrorCode registerErrorCode(String code, String message){
        return registerErrorCode(code,message,200);
    }

    public static ErrorCode registerErrorCode(String code, String message, int httpCode){
        return (new ErrorCode(code,message,httpCode));
    }
}
